package com.realtyManage.springboot.Dao;


import com.realtyManage.springboot.Model.Do.ExchangeCoupon;
import com.realtyManage.springboot.Model.Do.Tintegral;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
import java.util.List;

/**
 *积分兑换
 *
 * @author 杭州素色网络科技有限公司
 * @since 2020-01-08
 */

@Repository
public interface TintegralRepository extends JpaRepository<Tintegral, Integer>, JpaSpecificationExecutor<Tintegral> {

    @Query(value = "SELECT COUNT(1) FROM t_integral WHERE user_id = ?1 AND coupon_id  = ?2",nativeQuery = true)
    int useCoupon(Integer uid,Integer couponId);
}
